package com.authine.cloudpivot.ext.enums;
/**
 * 短信方法
 * author pyf
 */
public enum SMSActionEnum {

    SENDSMS(0, "SendSms"),
    SENDBATCHSMS(1, "SendBatchSms");

    public Integer id;
    public String text;

    SMSActionEnum(Integer id, String text) {

        this.id = id;
        this.text = text;
    }

    public static com.authine.cloudpivot.ext.enums.SMSActionEnum get(Object code) {
        if (code == null) {
            return null;
        }

        for ( SMSActionEnum c :  SMSActionEnum.values()) {
            if (String.valueOf(code).equals(String.valueOf(c.id))) {
                return c;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return text;
    }
}